<?php

namespace app\admin\middleware\common;

use Closure;
use think\Request;
use think\Response;
class EncryptFields
{
    /**
     * 处理请求
     *
     * @param Request $request
     * @param Closure $next
     * @return Response
     */
    public function handle(Request $request, Closure $next): Response
    {
        $response = $next($request);
        $encryptFields = json_encode(config('rds.encrypt_fields'));
        $response->header(['X-Fields-Encrypt' => $encryptFields]);
        return $response;
    }
}